<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;">
<!-- 标题 -->
<div class="page-heade">
    <h2 class="title_color text-center">渠道优惠政策详情</h2>
</div>
<!-- 标题 -->
<div class="form-inline">
    <form action="">
        <table class="row-margin-top tab-content table-bordered text-center table" border="1">
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">主题</td>
                <td class="text-left" colspan="3">{$data.title}</td>
                <td style="min-width: 160px;width: 160px" class="info">申请编号</td>
                <td style="min-width: 160px;width: 160px" class="text-left">{$data.sn}</td>
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">申请人</td>
                <td class="text-left">{$data.sqr}</td>
                <td style="min-width: 160px;width: 160px" class="info">所属部门</td>
                <td class="text-left">{$data.ssbm}</td>
                <td style="min-width: 160px;width: 160px" class="info">申请时间</td>
                <td style="min-width: 160px;width: 160px" class="text-left">{$data.sqtime}</td>
            </tr>
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">申请原因及其他说明</td>
                <td colspan="5">{$data.info}</td>
            </tr>
        </table>
        {volist name="mingxi" id="row"}
        <table class="row-margin-top tab-content table-bordered text-center table" border="1">
            <tr>
                <th colspan="4" class="text-left info">渠道政策明细</th>
            </tr>
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">区域信息({if $row.area==1}分区{elseif $row.area==2}省份{elseif $row.area==3}城市{elseif $row.area==4}经销商{/if})</td>
                <td class="text-left">{volist name="row.area_id" id="row2"}{$row2}{/volist}</td>
                <td style="min-width: 160px;width: 160px" class="info">优惠时段</td>
                <td style="min-width: 160px;width: 160px" class="text-left">从{$row.start}到{$row.end}</td>
            </tr>
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">申请原因及其他说明</td>
                <td colspan="3">{$row.brief}</td>
            </tr>
        </table>
        {/volist}
        <table class="row-margin-top tab-content table-bordered text-center table" border="1">
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">无政策销量(元)</td>
                <td class="text-left">{$data.saleNum}</td>
                <td style="min-width: 160px;width: 160px" class="info">政策预计销量(元)</td>
                <td class="text-left">{$data.policySaleNum}</td>
                <td style="min-width: 160px;width: 160px" class="info">销量增量(元)</td>
                <td class="text-left">{$data.saleInc}</td>
            </tr>
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">预计搭赠产生的费用(元)</td>
                <td class="text-left">{$data.estiGiftCost}</td>
                <td style="min-width: 160px;width: 160px" class="info">预计费用率</td>
                <td class="text-left">{$data.estiCostRate}%</td>
                <td style="min-width: 160px;width: 160px" class="info">预计回报率</td>
                <td class="text-left">{$data.estiReturnRate}%</td>
            </tr>
        </table>
        <form action="" class="form-inline" id="form1">
        <table class="row-margin-top tab-content table-bordered table" border="1">
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">撤销时间<span class="colorRed">*</span></td>
                <td>
                    <input type="text" id="start" class="form-control layer-date "
                           style="height: 26px;display: inline-block;" name="revoke_time" value="{:date('Y-m-d')}">
                </td>
            </tr>
            <tr>
                <td style="min-width: 160px;width: 160px" class="info">撤销原因<span class="colorRed">*</span></td>
                <td>
                    <textarea name="revoke_reason" id="" class="form-control" style="width: 60%;height:60px"></textarea><span
                        style="vertical-align: bottom;">(200)</span>
                </td>
            </tr>
        </table>

        <div class="row sub_btn" style="width:100%;text-align:center;padding: 20px 0">
            <input type="button" class="btn btn-success" value="撤销" id="revoke">
            <input type="button" class="btn btn-warning" value="返回" onclick="back()">
        </div>
        </form>
    </form>
</div>
<div class="applyImg font-bold" style="display: none">
    申报已生效
</div>
<!-- 全局js -->
{include file="Public/footer"}
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script>
    //插销
    $('#revoke').on('click',function () {
        var revoke_time = $('#start').val()
        var revoke_reason = $('[name=revoke_reason]').val()
        $.post('',{revoke_time:revoke_time,revoke_reason:revoke_reason},function (data) {
            if(data.success){
                swal({title:data.msg},function () {
                    back()
                })
            }else{
                swal(data.msg)
            }
        },'json')
    })
    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY-MM-DD',
        min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY-MM-DD',
        min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);

    function back() {
        history.go(-1)
    }
</script>
</body>

</html>
